<template>
  <el-radio-group v-model="selected" @change="change" :disabled="disabled" v-if="!plainText">
    <template v-if="type == 'button'">
      <el-radio
        :key="index"
        :label="item.value"
        :disabled="item.disabled"
        v-for="(item, index) in Options"
        >{{ item.label }}</el-radio
      >
    </template>
    <template v-if="type == 'radio'">
      <el-radio
        :key="index"
        :label="item.value"
        :disabled="item.disabled"
        v-for="(item, index) in Options"
        >{{ item.label }}</el-radio
      >
    </template>
  </el-radio-group>
  <div v-else>
    <span >{{ optionObj[selected] }}</span>
  </div>
</template>

<script>
import emitter from "element-ui/src/mixins/emitter";
import lazy from "./lazy.mixin.js";

export default {
  mixins: [emitter, lazy],
  model: {
    prop: "value",
    event: "change"
  },
  props: {
    value: String,
    type:{
      type:String,
      default:"radio"
    }
  },
  data() {
    return {
      selected: "",
      loading: true,
      nomore: false,
      page: 1,
      Options: [],
      optionObj: {}
    };
  },
  mounted() {
    // console.log(process.env,this.value);
    this.initSelect(1);
    //直接传入data，则可以不从远程获取数据
  },
  methods: {


  }
};
</script>

<style lang="scss" scoped>
.tip {
  font-size: 10px;
  text-align: center;
  margin: 0;
  padding: 12px 0 8px 0;
  color: #999;
}
</style>
